﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml;
using System.Xml.Linq;

namespace WEEK10_LECTURE
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string filePath = Server.MapPath("汽车（有换行）.xml");

            try
            {
                XmlReader reader = XmlReader.Create(filePath);

                while (reader.Read())
                {
                    Response.Write(
                        string.Format(
                            "【NodeName: <font color=blue>{0}</font>】【NodeValue:  <font color=green>{1}</font>】【NodeType:  <font color=red>{2}</font>】<br/>",
                            reader.Name,
                            reader.Value, reader.NodeType));
                }
                reader.Close();
            }
            catch (Exception exception)
            {
                Response.Write(exception.Message);
            }
        }
    }
}